// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.modding;

import java.util.ArrayList;
import java.util.UUID;
import zombie.characters.IsoPlayer;
import zombie.inventory.InventoryItem;
import zombie.network.GameClient;
import zombie.network.GameServer;

public final class ModUtilsJava {
    public static String getRandomUUID() {
        return UUID.randomUUID().toString();
    }

    public static boolean sendItemListNet(IsoPlayer sender, ArrayList<InventoryItem> items, IsoPlayer receiver, String transferID, String custom) {
        if (items != null) {
            transferID = transferID != null ? transferID : "-1";
            if (GameClient.bClient) {
                if (items.size() > 50) {
                    return false;
                }

                for (int _int = 0; _int < items.size(); _int++) {
                    InventoryItem inventoryItem = (InventoryItem)items.get(_int);
                    if (!sender.getInventory().getItems().contains(inventoryItem)) {
                        return false;
                    }
                }

                return GameClient.sendItemListNet(sender, items, receiver, transferID, custom);
            }

            if (GameServer.bServer) {
                return GameServer.sendItemListNet(null, sender, items, receiver, transferID, custom);
            }
        }

        return false;
    }
}
